package com.example;

import com.alibaba.druid.pool.DruidDataSource;
import com.example.config.ApplicationConfig;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import javax.sql.DataSource;

public class Application_11 {
    public static void main(String[] args) {
        // 创建注解容器，指定配置类(传入字节码对象)
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(ApplicationConfig.class);
        //User userEntity = (User) context.getBean("userEntity");
        //System.out.println(userEntity);
        //DruidDataSource dataSource = (DruidDataSource) context.getBean("dataSource");
        //System.out.println(dataSource);
        DataSource bean = context.getBean(DruidDataSource.class);
        System.out.println(bean);
    }
}